package com.guoyu.gserv.dao.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.guoyu.gserv.dao.UsrDAO;
import com.guoyu.gserv.entity.UserInfo1;
import com.guoyu.gserv.entity.Usr;

public class UsrDAOImpl implements UsrDAO {
	private SessionFactory sessionFactory;
	
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	
	public Session getSession() {
		return sessionFactory.getCurrentSession();
	}

	public Usr load(int uno) {
		// TODO Auto-generated method stub
		Usr u1 = (Usr) getSession().load(Usr.class, uno);
		return u1;
	}

	public void save(Usr u1) {
		// TODO Auto-generated method stub
		getSession().save(u1);
	}
	public UserInfo1 findUserbyname(String username)
	{
		return null;
	}
}
